import './App.css';
import {Switch,Route,Redirect} from 'react-router-dom'
//引入一级路由组件
import Index from './pages'
import List from './pages/list'
import Play from './pages/play'
function App() {
  return (
    <div className="App">
      {/* 主组件中不能写任何内容除了一级路由出口 */}
      <Switch>
        <Route path='/index' component={Index}></Route>
        <Route path='/list/:id' component={List}></Route>
        <Route path='/play' component={Play}></Route>
        {/* 路由重定向 */}
        <Redirect to='/index'></Redirect>
      </Switch>
    </div>
  );
}

export default App;
